import { Map } from "immutable";
import * as actionTypes from "./constants";

const defaultState = Map({
  playlists: [],
  playlistComments: [],
});

const a = (state = defaultState, action) => {
  switch (action.type) {
    case actionTypes.GETPLAYLISTCONTENT:
      return state.set("playlists", action.playlists);
    case actionTypes.GETPLAYLISTCOMMENT:
      return state.set("playlistComments", action.playlistComment);
    default:
      return state;
  }
};

export default a;
